<?php
include_once '../action/alihtgjwbController.php';
include 'z_header.php';
if(!isset($_SESSION['nip'])){
    header('location:login.php');
}
if(isset($error))
        {
                echo '<div class="alert alert-error" id="alert">'.$error.'
                      <button type="button" class="close" data-dismiss="alert" id="close">×</button></div>';
        }
if(isset($berhasil))
        {
                echo '<div class="alert alert-success" id="alert">'.$berhasil.'
                      <button type="button" class="close" data-dismiss="alert" id="close">×</button></div>';
        }
?>
<div class="container">  
<div class="row">
<div class="span12">
<form method="post" action="">
<table class="table table-striped">  
    <fieldset>  
         <legend><div class="pull-left">Daftar Permintaan Alih Tanggungjawab Pekerjaan</div>
         </legend>  
        <thead>  
          <tr>  
            <th width="150">NIP & Nama Pegawai</th>  
            <th width="150">Jenis Cuti</th>
            <th width="200">Tgl Cuti</th>
            <th width="300">Catatan Pengajuan</th>
            <th width="100">Approval</th>
          </tr>  
        </thead>
        <tbody> 
            <?php 
            if($data_alih!=NULL){
                foreach ($data_alih as $data){
            ?>
            <tr>  
            <td><?php echo $data->nip_pengaju; ?> <br>
                <?php echo $data->nama_pengaju; ?>  
            </td> 
            <td><?php echo $data->kategori_cuti; ?></td> 
            <td><?php echo $data->tanggal_awal.' s/d '.$data->tanggal_akhir; ?></td>
            <td><?php echo $data->catatan_pengaju; ?></td>
            <td><?php if($data->status==1){ ?> 
                <input type="hidden" name="id_cuti" value="<?php echo $data->id_cuti ;?>">
                <input type="submit" class="btn btn-primary" name="approve" value="Setujui">
                <?php }else{
                    echo "<strong>DISETUJUI</strong>";
                } ?>
            </td>
          </tr> 
          <?php }
            }else{ ?>
                <td>Kosong</td>
                <td>Kosong</td>
                <td>Kosong</td>
                <td>Kosong</td>
                <td align="center">-</td>
           <?php } ?>
        </tbody>  
        </fieldset>
      </table>
</form>
</div>

<?php include_once 'z_footer.php'; 